﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace GuildofHeroes
{
    class Mage : Player
    {
        int _AdditionalHealth = 15;
        int _AdditionalMana = 15;
        int _AdditionalIntelligence = 8;
        int _AdditionalWisdom = 6;        

        public Mage(Texture2D pTexture2D, int pPosX, int pPosY, int pNumFrames, int pFrameWidth, int pFrameHeight,
            int pHorizontalSpace, int pVerticalSpace, int pFramesPerSec, float pScale) :
            base(pTexture2D, pPosX, pPosY, pNumFrames, pFrameWidth, pFrameHeight, pHorizontalSpace, pVerticalSpace, pFramesPerSec, pScale)
        {
            base._BaseIntelligence += _AdditionalIntelligence;
            base._BaseWisdom += _AdditionalWisdom;
            base._BaseMana += _AdditionalMana + _BaseWisdom / 2;
            base._BaseHealth += _AdditionalHealth + _BaseConstitution / 2;            
            base._BaseDamage += _BaseIntelligence / 5;
            base.m_Health = base._BaseHealth;
            base.m_Mana = base._BaseMana;
        }

        public override void Draw(SpriteBatch _spriteBatch, SpriteFont _spriteFont)
        {
            _spriteBatch.DrawString(_spriteFont, "Health: " + this.GetHealth().ToString(), new Vector2(20, 20), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Mana: " + this.GetMana().ToString(), new Vector2(150, 20), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Gold: " + this.GetGold().ToString(), new Vector2(270, 20), Color.White);            
            _spriteBatch.DrawString(_spriteFont, "Exp: " + this.GetExp().ToString(), new Vector2(20, 120), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Level: " + this.GetLevel().ToString(), new Vector2(20, 170), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Next Level: " + this.GetNextLevel().ToString(), new Vector2(20, 220), Color.White);
            _spriteBatch.DrawString(_spriteFont, "Dmg Rating: " + this.GetDmgRating().ToString(), new Vector2(20, 250), Color.White);
            base.Draw(_spriteBatch, _spriteFont);
        }

        public override void LevelUp()
        {

            base.LevelUp();
            _BaseHealth += 5 + (_Level + _BaseConstitution / 2);
            _BaseMana += 15 + (_Level + _BaseWisdom / 2);
            _BaseDamage += 1;
            m_Health = _BaseHealth;
            m_Mana = _BaseMana;
        }
    }
}
